﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />

<title>项目预约管理修改</title>
</head>
<body>
 <div class="pd-20">
  <form  method="post" class="form form-horizontal" id="form1">
    <input type="hidden" name="productId" id="productId" value="${project.productId}">
 
    <input type="hidden" name="customerId" id="customerId" value="${project.customerId}">
    
    <div class="row cl">
      <label class="form-label col-2"><span class="c-red">*</span>产品名称：</label>
      <div class="formControls col-4">
        <input type="text" class="input-text"   placeholder="输入产品名称" id="projectName" name="projectName"  value="${project.projectName}" readonly="readonly" >
      </div>
      <label class="form-label col-2"><span class="c-red">*</span>客户姓名：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="customerName" id="customerName" value="${project.customerName}" readonly="readonly">
        </div>
    </div>
    
     <div class="row cl">
      <label class="form-label col-2"><span class="c-red">*</span>客户手机号：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="mobileNumber" id="mobileNumber" value="${project.mobileNumber}"  >
        </div>
     <label class="form-label col-2"><span class="c-red">*</span>客户身份证号：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="idCard" id="idCard" value="${project.idCard}"  >
        </div>
    </div>
    
    <div class="row cl">
     <label class="form-label col-2"><span class="c-red">*</span>客户性质：</label>
      <div class="formControls col-4"><span class="select-box">
        <select class="select"  size="1" id="type" name="type"  disabled="disabled">
			      	 <!-- <option value="" selected="selected">全部</option> -->
				     <c:if test="${typeList !=null}">
					       <c:forEach items="${typeList}" var="pl">
					        <option value="${pl.value}"  <c:if test="${product.type==pl.value}">selected="selected"</c:if> > ${pl.description}</option>
					       </c:forEach>
				      </c:if>
			   </select>
        </span>
      </div>
     <label class="form-label col-2"><span class="c-red">*</span>预约类型：</label>
      <div class="formControls col-4"><span class="select-box">
        <select class="select"  size="1" id="reserveType" name="reserveType"  disabled="disabled">
				     <c:if test="${reserveTypeList !=null}">
					       <c:forEach items="${reserveTypeList}" var="pl">
					        <option value="${pl.value}" <c:if test="${product.reserveType==pl.value}">selected="selected"</c:if> > ${pl.description}</option>
					       </c:forEach>
				      </c:if>
			   </select>
        </span>
      </div>
    </div>
   
    <div class="row cl"   >
      <label class="form-label col-2"><span class="c-red">*</span>预计打款时间：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="paymoneyDate" id="paymoneyDate"  value="${project.paymoneyDate}" readonly="readonly">
        </div>
       
        <label class="form-label col-2"><span class="c-red">*</span>预约金额(万)：</label>
        <div class="formControls col-3">
           <input type="text" class="input-text"  name="preAmount" id="preAmount"  value="${project.preAmount}" readonly="readonly">
        </div>
         <label>万</label>
    </div>
     
    <div class="row cl"    >
      <label class="form-label col-2"><span class="c-red">*</span>推荐人姓名：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="userName" id="userName"  value="${project.userName}" readonly="readonly">
        </div>
      <label class="form-label col-2"><span class="c-red">*</span>状态：</label>
        <div class="formControls col-4">
           <span class="select-box">
        <select class="select"  size="1" id="status" name="status"   >
				     <c:if test="${statusList !=null}">
					       <c:forEach items="${statusList}" var="pl">
					        <option value="${pl.value}" > ${pl.description}</option>
					       </c:forEach>
				      </c:if>
			   </select>
        </span>
        </div>
    </div>
      
     <div class="row cl"    >
       <label class="form-label col-2"><span class="c-red">*</span>受益人：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="benefitPerson" id="benefitPerson"  value="${product.benefitPerson}"  >
        </div>
       <label class="form-label col-2"><span class="c-red">*</span>说明：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="instruction" id="instruction"  value="${product.instruction}"  >
        </div>
    </div>
    
    <div class="row cl"    >
      <label class="form-label col-2"><span class="c-red">*</span>汇款银行：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="txtBank" id="txtBank"  value="${product.txtBank}"  >
        </div>
       <label class="form-label col-2"><span class="c-red">*</span>银行尾号：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="txtBank" id="txtBank"  value="${product.txtAccount}"  >
        </div>
    </div>
    
    <div class="row cl"    >
      <label class="form-label col-2"><span class="c-red">*</span>预期收益%：</label>
        <div class="formControls col-4">
           <input type="text" class="input-text"  name="expectedProfit" id="expectedProfit"  value="${product.expectedProfit}"  >
        </div>
        
    </div>
     
    <div class="row cl"    >
        <label class="form-label col-2"><span class="c-red">*</span>成立日期：</label>
        <div class="formControls col-4">
             <input type="text"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'1960-01-01',maxDate:'2050-12-31'})" id="createDate" name="createDate" class="input-text Wdate" style="width:90%"  value="${product.createDate}" >
        </div>
      <label class="form-label col-2"><span class="c-red">*</span>清算日期：</label>
        <div class="formControls col-4">
             <input type="text"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'1960-01-01',maxDate:'2050-12-31'})" id="endDate" name="endDate" class="input-text Wdate" style="width:90%"  value="${product.endDate}" >
        </div>
      
    </div>
    
    <div class="row cl">
      <label class="form-label col-2"><span class="c-red">*</span>合同快递单号,寄给客户：</label>
      <div class="formControls col-4">  
          <input type="text" class="input-text"  name="logisticsNumberCustomer" id="logisticsNumberCustomer"   value="${product.logisticsNumberCustomer}">
      </div>
      <label class="form-label col-2"><span class="c-red">*</span>合同快递单号,寄回公司：</label>
      <div class="formControls col-4">  
          <input type="text" class="input-text"  name="logisticsNumberCompany" id="logisticsNumberCompany"   value="${product.logisticsNumberCompany}">
      </div>
    </div>
    
    <div class="row cl">
      <label class="form-label col-2"><span class="c-red">*</span>公司名称：</label>
      <div class="formControls col-4">  
          <input type="text" class="input-text"  name="companyName" id="companyName"    value="${product.companyName}" >
      </div>
      <label class="form-label col-2"><span class="c-red">*</span>企业法人：</label>
      <div class="formControls col-4">  
          <input type="text" class="input-text"  name="legalPerson" id="legalPerson"    value="${product.legalPerson}" >
      </div>
    </div>
     
     
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <!-- <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;"> -->
        <button  class="btn btn-primary radius" type="submit" >&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
        &nbsp;&nbsp;<input id="closeBtn"  class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;关闭&nbsp;&nbsp;">
      </div>
    </div>
  </form>
</div>

<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/My97DatePicker/WdatePicker.js"></script> 
 
<script type="text/javascript" charset="utf-8" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/umeditor1_2_2/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/umeditor1_2_2/umeditor.min.js"></script>
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/ueditor/umeditor1_2_2/lang/zh-cn/zh-cn.js"></script>
    
    
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/js/H-ui.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/js/H-ui.admin.js"></script>
<script type="text/javascript" src="<%=basePath%>common/js/cms.js"></script>
 
<script type="text/javascript">

$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form1").Validform({
		tiptype:2,
		beforeSubmit:function(curform){
			 //在验证成功后，表单提交前执行的函数，curform参数是当前表单对象。
            //这里明确return false的话表单将不会提交;
			submitForm(curform) ;
			return false ;
		},
		callback:function(form){
			return false ;
		}
	});
	
	function submitForm(form ){
		
		var params = JSON.stringify( $("#form1").serializeJson()) ;
		$.ajax({
			"type": "POST", 
			"url": "<%=basePath%>projectmgr/doadd"  , 
			"dataType": "json",  // 预期服务器返回的数据类型
			"data": "params="+params ,      
			"success": function(resp) {
				// console.log(resp) ;
				if(resp.success){
					   
					   //  layer.msg("预约项目成功",{icon:2,time:2000});
						layer.alert("预约项目成功,请到预约项目中查看!", {icon: 2},function(index){
							 var index = parent.layer.getFrameIndex(window.name);
							 parent.layer.close(index);
						  });
				}else{
					layer.alert( resp.errMsg, {icon: 2},function(index){
						 layer.close(index);
					  });
				}
				 
			}
		}); 
	}
	
	$("#closeBtn").click(function(){
		var index = parent.layer.getFrameIndex(window.name);
		parent.layer.close(index);
	});
	
	
	$('#type').change(function(){ 
		var p1=$(this).children('option:selected').val();//这就是selected的值 
		 
		if(p1 ==1 ){
			 $("#sadiv").hide();
		}else{
			 $("#sadiv").show();
		}
	}) 
	
});

function selectProduct(){
	var url ="<%=basePath%>productmgr/tolist?type=10"  ;
	// layer_show('选择产品',url,'','');
	
	  var index = layer.open({
		type: 2,
		title: '选择产品',
		content: url
	});
	layer.full(index);  
}

//选择产品数据 设值
function setObject(productObj){
	//  console.log(productObj) ;
	 $("#productId").val(productObj.id) ;
	 $("#projectName").val(productObj.name) ;
	 $("#surplusAmount").val(productObj.surplusAmount) ;
	 $("#subscribePoint").val(productObj.subscribePoint) ;
}
</script>
</body>
</html>